package game

import (
	"GameServer/common/logger"
	jconf "GameServer/jsonconfig"
	nt "GameServer/network"
	"github.com/gin-gonic/gin"
	"net/http"

	"time"
)

//计时器

func ClearData(c *gin.Context) {
	pn := c.Query("a")
	logger.Info("ClearData, pn:%+v", pn)
}

func ReloadCfg(c *gin.Context) {
	jconf.Init()
	c.JSON(http.StatusOK, gin.H{
		"errorCode": 50002,
		"errorMsg":  "sb",
		"result":    "0",
	})
	c.Data(http.StatusOK, "sb", []byte("sss"))
}

func TestRpc(c *gin.Context) {
	nt.DoRPCCreateRoom(1, "shabi")
	c.Data(http.StatusOK, "sb", []byte("test rpc success！"))
}

func AddGoldWithiut(c *gin.Context) {
	c.JSONP(http.StatusOK, gin.H{
		"errorCode": 50002,
		"errorMsg":  "sb",
		"result":    "0",
	})
}

func GetTask() {
	for {
		select {
		case <-time.After(100 * time.Millisecond):

		}
	}
}
